/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Vectors.MultiThreding;

import Vectors.Patterned.Observer;
import Vectors.Patterned.Observable;
import Vectors.Exceptions.VectorIndexOutOfBoundsException;
import Vectors.Exceptions.IncompatibleVectorSizesException;
import Vectors.IVector;
import Vectors.Patterned.Observable;
import Vectors.Patterned.Observer;
import Vectors.Vector;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author netcracker
 */
public class SafeVector implements IVector, Observable {
    
    IVector vector;
    private ArrayList<Observer> observers;
    
    public SafeVector(int length) {
    vector = new SafeVector(length);
    }
    
    @Override
    public void add(double o) {
        vector.add(o);
    }
    
    @Override
    public void delete(int index) {
        vector.delete(index);
    }
    
    @Override
    public Double get(int id) {
        return vector.get(id);
    }
    
    @Override
    public void set(double value, int position) {
        vector.set(value, position);
    }
    
    @Override
    public void fill(double[] mass) throws IncompatibleVectorSizesException {
        vector.fill(mass);
    }
    
    @Override
    public void fill(IVector myVector) throws IncompatibleVectorSizesException {
        vector.fill(myVector);
    }
    
    @Override
    public boolean isSame(IVector myVector) throws IncompatibleVectorSizesException {
        return vector.isSame(myVector);
    }
    
    @Override
    public int getLength() {
        return vector.getLength();
    }
    
    @Override
    public void multiply(double f) {
        vector.multiply(f);
    }
    
    @Override
    public void plus(IVector llv) throws IncompatibleVectorSizesException {
        vector.plus(llv);
    }
    
    @Override
    public void sort() {
        vector.sort();
    }
    
    @Override
    public void swap(int i, int j) {
        vector.swap(i, j);
    }
    
    @Override
    public IVector clone() throws CloneNotSupportedException {
        return vector.clone();
    }
    
    @Override
    public Iterator<Double> iterator() {
        return vector.iterator();
    }
    
    @Override
    public void addObserver(Observer observer) {
        vector.addObserver(observer);
    }
    
    @Override
    public void removeObserver(Observer observer) {
        vector.removeObserver(observer);
    }
    
    @Override
    public void notifyToObservers() {
        vector.notifyToObservers();
    }
    
    @Override
    public void notifyToObservers(int index, double value) {
        vector.notifyToObservers(index, value);
    }
}
